package com.example.aigc_education.ws.handler;

import com.example.aigc_education.integration.request.ChatMessageRequestV2;
import com.example.aigc_education.rpc.api.v2.ChatServiceProto;

public class DefaultMessageHandler implements MessageHandler{

    @Override
    public ChatMessageRequestV2 handle(ChatServiceProto.ChatMessage chatMessage) {
        return ChatMessageRequestV2.builder()
                .userId("")
                .convId("")
                .content("")
                .role(ChatMessageRequestV2.Role.AI)
                .messageId(String.valueOf(System.currentTimeMillis()))
                .type("text")
                .build();
    }

    @Override
    public boolean canHandle(ChatServiceProto.ChatMessage chatMessage) {
        return true; // 默认处理器可以处理任何消息
    }
}
